/**
 * 
 */
package com.thread;

/**
 * @author lionbule
 *
 */
public class TestTheadSleepWait {
    
	public static void main(String[] args) {
	    Thread t = new Thread(new Runnable() {
            
            @Override
            public void run() {
                while(true){
                    try {
                        System.out.println("inner Thread.");
                        synchronized (this) {
                            this.wait(1000);
                        }
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
	    t.setName("lionbule");
	    t.start();
	    
	    for(int i=0;i<10000;i++){
	        try {
	            System.out.println("count="+i);
                Thread.sleep(30000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
	    }
	}
}
